package perform.broker;

import java.sql.Connection;
import java.util.List;

import perform.criterion.Criterion;
import perform.criterion.Order;
import perform.type.Type;

public interface DatabaseBroker {

	public <T extends Type> T save(T type, Connection connection)
			throws Exception;

	public <T extends Type> void update(T type, Connection connection)
			throws Exception;

	public <T extends Type> void delete(T type, Connection connection)
			throws Exception;

	public <T extends Type> T get(T type, Connection connection)
			throws Exception;

	public <T extends Type> List<T> get(Class<T> clazz, Criterion criterion,
			Connection connection) throws Exception;

	public <T extends Type> List<T> get(Class<T> clazz, Criterion criterion,
			Order order, Connection connection) throws Exception;

	public <T extends Type> List<T> get(Class<T> clazz, Criterion criterion,
			Order order, int lowLimit, int highLimit, Connection connection)
			throws Exception;

	public <T extends Type> List<T> get(Class<T> clazz, String criteria,
			Connection connection) throws Exception;

	public <T extends Type> List<T> get(Class<T> clazz, String criteria,
			Order order, Connection connection) throws Exception;

	public <T extends Type> List<T> get(Class<T> clazz, String criteria,
			Order order, int lowLimit, int highLimit, Connection connection)
			throws Exception;

	public <T extends Type> List<T> getCustom(Class<T> clazz, String from,
			Connection connection) throws Exception;

	public void customUpdate(String query, Connection connection)
			throws Exception;

}
